/*
 * ansi.h - ANSI escape sequences
 *
 * References:
 *  http://en.wikipedia.org/wiki/ANSI_escape_code
 *  http://ascii-table.com/ansi-escape-sequences.php
 */

#define CSI "\033["

#define CUU(n) CSI #n "A" /* CUrsor Up */
#define CUD(n) CSI #n "B" /* CUrsor Down */
#define CUF(n) CSI #n "C" /* CUrsor Forward */
#define CUB(n) CSI #n "D" /* CUrsor Backward */
#define CNL(n) CSI #n "E" /* Cursor Next Line */
#define CPL(n) CSI #n "F" /* Cursor Previous Line */
#define CHA(n) CSI #n "G" /* Cursor Horizontal Absolute */
#define CUP(n,m) CSI #n ";" #m "H" /* CUrsor Position */
#define ED(n) CSI #n "J" /* Erase Data */
#define EL(n) CSI #n "K" /* Erase Line */


#define RESET      CSI "0m"
#define BOLD       CSI "1m"
#define FAINT      CSI "2m"
#define ITALIC     CSI "3m"
#define UNDER      CSI "4m"
#define BLINK      CSI "5m"
#define INVERSE    CSI "7m"
#define CONCEAL    CSI "8m"

#define NORMAL     CSI "22m"
#define ITALIC_OFF CSI "23m"
#define UNDER_NONE CSI "24m"
#define BLINK_OFF  CSI "25m"
#define POSITIVE   CSI "27m"
#define REVEAL     CSI "28m"

#define FG_BLACK   CSI "30m"
#define FG_RED     CSI "31m"
#define FG_GREEN   CSI "32m"
#define FG_YELLOW  CSI "33m"
#define FG_BLUE    CSI "34m"
#define FG_MAGENTA CSI "35m"
#define FG_CYAN    CSI "36m"
#define FG_WHITE   CSI "37m"
#define FG_DEFAULT CSI "39m"

#define BG_BLACK   CSI "40m"
#define BG_RED     CSI "41m"
#define BG_GREEN   CSI "42m"
#define BG_YELLOW  CSI "43m"
#define BG_BLUE    CSI "44m"
#define BG_MAGENTA CSI "45m"
#define BG_CYAN    CSI "46m"
#define BG_WHITE   CSI "47m"
#define BG_DEFAULT CSI "49m"
